package javaweb_work01.main.Service;

import javaweb_work01.main.Dao.AddStudentsDao;
import javaweb_work01.main.Entity.Students;
import javaweb_work01.main.Factory.StudentsFactory;

public class AddService {
    //合成复用原则
    private AddStudentsDao addStudentsDao;

    public AddService(){
        this.addStudentsDao = StudentsFactory.getAddStudentsDao();
    }

    /**
     * 自定义成员方法实现根据参数指定的Students对象来调用DAO层实现添加学员信息功能
     * @param students
     * @return
     */
    public int addStudentsService(Students students){
        return addStudentsDao.addStudents(students);
    }
}
